You can compare pointers using just the same operators as you use for numbers. If one pointer is larger than another it means that it points to a location further down memory. If two pointers are equal it means that they both point at the same location (note that there is nothing wrong with two pointers pointing at the same place).
Remember that there is a subtle distinction between:
/* compare two pointers */ if ( ptr1 == ptr2 )
and
/* compare what they point at */ if ( *ptr1 == *ptr2 )
The first line of C will be true if both pointers point at the same location. The second line is true if the things they point at have the same value.
In the diagram on the right both pointers are pointing at i, and therefore a test for equality will therefore succeed. Note also that if you change the thing that ptr1 is pointing at, the thing that ptr2 points at changes as well!
Two pointers can point at the same location